import axios from "axios";

export default{
    common:{
        method:"get",
        data:"",
        params:""
    },
    $axios(options={}){
        options.method = options.method || this.common.method;
        options.data = options.data || this.common.data;
        options.params = options.params || this.common.params;

        return axios(options).then(res=>{
            let data = res.data.data;

            return new Promise((resolve,reject)=>{
                if(!res) return reject(res);
                resolve(data);
            })
        })
    }

    
}